17. Exercise: Add an AsyncTaskLoader

Let's use an AsyncTaskLoader instead of AsyncTask in our GitHub query application! Follow the TODOs in the exercise code.

Exercise Code

Exercise: T05b.02-Exercise-AddAsyncTaskLoader

SOLUTION:
  • Have MainActivity implement the LoaderCallbacks
  • Create the GITHUB_SEARCH_LOADER ID
  • Fill out the loader callbacks
  • Restart the loader when the button is clicked
  • Initialize the loader during onCreate